package AJava1月.EJava第五周.练习题02;

import java.util.Scanner;

public class C求质数 {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个整数");
        int number = sc.nextInt();

         boolean a =true;

        for (int i = 2; i <=number - 1  ; i++) {
            if (number % i == 0){
                a = false;
                break;
            }
        }

        if(a){
            System.out.println("是质数");
        }else {
            System.out.println("不是质数");
        }

    }
    }
